<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="Hexo Theme Keep">
    <meta name="description" content="宋标的个人博客">
    <meta name="author" content="宋标">
	<meta name="referrer" content="no-referrer"/>
    
    <title>
        
        宋标的blog
    </title>
    
<link rel="stylesheet" href="/css/style.css">

    <link rel="shortcut icon" href="/images/logo.svg">
    
<link rel="stylesheet" href="/css/font-awesome.min.css">

    <script id="hexo-configurations">
    let KEEP = window.KEEP || {};
    KEEP.hexo_config = {"hostname":"song_biao.gitee.io","root":"/","language":"zh-CN","path":"search.xml"};
    KEEP.theme_config = {"toc":{"enable":true,"number":true,"expand_all":true,"init_open":true},"style":{"primary_color":"#0066CC","avatar":"/images/avatar.svg","favicon":"/images/logo.svg","article_img_align":"left","left_side_width":"260px","content_max_width":"920px","hover":{"shadow":false,"scale":false},"first_screen":{"enable":true,"background_img":"/images/bg.svg","description":"while(alive()) study();"},"scroll":{"progress_bar":{"enable":false},"percent":{"enable":false}}},"local_search":{"enable":true,"preload":false},"code_copy":{"enable":false,"style":"default"},"pjax":{"enable":false},"lazyload":{"enable":false},"version":"3.4.5"};
    KEEP.language_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
  </script>
<meta name="generator" content="Hexo 6.1.0"><style>mjx-container[jax="SVG"] {
  direction: ltr;
}

mjx-container[jax="SVG"] > svg {
  overflow: visible;
}

mjx-container[jax="SVG"][display="true"] {
  display: block;
  text-align: center;
  margin: 1em 0;
}

mjx-container[jax="SVG"][justify="left"] {
  text-align: left;
}

mjx-container[jax="SVG"][justify="right"] {
  text-align: right;
}

g[data-mml-node="merror"] > g {
  fill: red;
  stroke: red;
}

g[data-mml-node="merror"] > rect[data-background] {
  fill: yellow;
  stroke: none;
}

g[data-mml-node="mtable"] > line[data-line] {
  stroke-width: 70px;
  fill: none;
}

g[data-mml-node="mtable"] > rect[data-frame] {
  stroke-width: 70px;
  fill: none;
}

g[data-mml-node="mtable"] > .mjx-dashed {
  stroke-dasharray: 140;
}

g[data-mml-node="mtable"] > .mjx-dotted {
  stroke-linecap: round;
  stroke-dasharray: 0,140;
}

g[data-mml-node="mtable"] > svg {
  overflow: visible;
}

[jax="SVG"] mjx-tool {
  display: inline-block;
  position: relative;
  width: 0;
  height: 0;
}

[jax="SVG"] mjx-tool > mjx-tip {
  position: absolute;
  top: 0;
  left: 0;
}

mjx-tool > mjx-tip {
  display: inline-block;
  padding: .2em;
  border: 1px solid #888;
  font-size: 70%;
  background-color: #F8F8F8;
  color: black;
  box-shadow: 2px 2px 5px #AAAAAA;
}

g[data-mml-node="maction"][data-toggle] {
  cursor: pointer;
}

mjx-status {
  display: block;
  position: fixed;
  left: 1em;
  bottom: 1em;
  min-width: 25%;
  padding: .2em .4em;
  border: 1px solid #888;
  font-size: 90%;
  background-color: #F8F8F8;
  color: black;
}

foreignObject[data-mjx-xml] {
  font-family: initial;
  line-height: normal;
  overflow: visible;
}

.MathJax path {
  stroke-width: 3;
}

mjx-container[display="true"] {
  overflow: auto hidden;
}

mjx-container[display="true"] + br {
  display: none;
}
</style></head>


<body>
<div class="progress-bar-container">
    

    
</div>


<main class="page-container">

    

    <div class="page-main-content">

        <div class="page-main-content-top">
            <header class="header-wrapper">

    <div class="header-content">
        <div class="left">
            
            <a class="logo-title" href="/">
                宋标的blog
            </a>
        </div>

        <div class="right">
            <div class="pc">
                <ul class="menu-list">
                    
                        <li class="menu-item">
                            <a class="active"
                               href="/"
                            >
                                首页
                            </a>
                        </li>
                    
                        <li class="menu-item">
                            <a class=""
                               href="/tags"
                            >
                                标签
                            </a>
                        </li>
                    
                        <li class="menu-item">
                            <a class=""
                               href="/categories"
                            >
                                分类
                            </a>
                        </li>
                    
                        <li class="menu-item">
                            <a class=""
                               href="/archives"
                            >
                                归档
                            </a>
                        </li>
                    
                    
                        <li class="menu-item search search-popup-trigger">
                            <i class="fas fa-search"></i>
                        </li>
                    
                </ul>
            </div>
            <div class="mobile">
                
                    <div class="icon-item search search-popup-trigger"><i class="fas fa-search"></i></div>
                
                <div class="icon-item menu-bar">
                    <div class="menu-bar-middle"></div>
                </div>
            </div>
        </div>
    </div>

    <div class="header-drawer">
        <ul class="drawer-menu-list">
            
                <li class="drawer-menu-item flex-center">
                    <a class="active"
                       href="/">首页</a>
                </li>
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/tags">标签</a>
                </li>
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/categories">分类</a>
                </li>
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/archives">归档</a>
                </li>
            
        </ul>
    </div>

    <div class="window-mask"></div>

</header>


        </div>

        <div class="page-main-content-middle">

            <div class="main-content">

                
                    <div class="home-content-container fade-in-down-animation">
    <ul class="home-article-list">
        
            <li class="home-article-item">

                

                <h3 class="home-article-title">
                    <a href="/2022/08/18/AcWing%201259.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E9%81%8D%E5%8E%86/">
                        AcWing 1259. 二叉树遍历
                    </a>
                </h3>

                <div class="home-article-content markdown-body">
                    
                        

题目树和二叉树基本上都有先序、中序、后序、按层遍历等遍历顺序，给定中序和其它一种遍历的序列就可以确定一棵二叉树的结构。
假定一棵二叉树一个结点用一个字符描述，现在给出中序和按层遍历的字符串，求该树的先序遍历字符串。
输入格式两行，每行是由大写字母...
                    
                </div>

                <div class="home-article-meta-info-container">
    <div class="home-article-meta-info">
        <span><i class="fas fa-history"></i>&nbsp;<span class="home-article-date" data-date="Thu Aug 18 2022 02:31:40 GMT+0800">2022-08-18</span></span>
        
            <span class="home-article-category"><i class="fas fa-folder"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/categories/Acwing/">Acwing</a>&nbsp;
                        </li>
                    
                    
                </ul>
            </span>
        
        
            <span class="home-article-tag">
                <i class="fas fa-tags"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/tags/BFS/">BFS</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E6%A0%91%E7%9A%84%E9%81%8D%E5%8E%86/">树的遍历</a>&nbsp;
                        </li>
                    
                </ul>
            </span>
        
    </div>

    <a href="/2022/08/18/AcWing%201259.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E9%81%8D%E5%8E%86/">阅读全文&nbsp;<i class="fas fa-angle-right"></i></a>
</div>

            </li>
        
            <li class="home-article-item">

                

                <h3 class="home-article-title">
                    <a href="/2022/08/18/AcWing%201491.%20%E5%9C%86%E6%A1%8C%E5%BA%A7%E4%BD%8D/">
                        AcWing 1491. 圆桌座位
                    </a>
                </h3>

                <div class="home-article-content markdown-body">
                    
                        

题目 个人围坐一圈，有  对朋友关系。
第  对朋友关系是指，编号是  的人和编号是  的人是朋友。
现在要给他们安排座位，要求所有相邻的人不能是朋友。
问共有多少种方案？
如果两个方案只有旋转角度不同，则我们将其视为一种方案。
输入格式第一行包...
                    
                </div>

                <div class="home-article-meta-info-container">
    <div class="home-article-meta-info">
        <span><i class="fas fa-history"></i>&nbsp;<span class="home-article-date" data-date="Thu Aug 18 2022 02:31:39 GMT+0800">2022-08-18</span></span>
        
            <span class="home-article-category"><i class="fas fa-folder"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/categories/Acwing/">Acwing</a>&nbsp;
                        </li>
                    
                    
                </ul>
            </span>
        
        
            <span class="home-article-tag">
                <i class="fas fa-tags"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/tags/DFS/">DFS</a>&nbsp;
                        </li>
                    
                </ul>
            </span>
        
    </div>

    <a href="/2022/08/18/AcWing%201491.%20%E5%9C%86%E6%A1%8C%E5%BA%A7%E4%BD%8D/">阅读全文&nbsp;<i class="fas fa-angle-right"></i></a>
</div>

            </li>
        
            <li class="home-article-item">

                

                <h3 class="home-article-title">
                    <a href="/2022/08/18/AcWing%2030.%20%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E5%8C%B9%E9%85%8D/">
                        AcWing 30. 正则表达式匹配
                    </a>
                </h3>

                <div class="home-article-content markdown-body">
                    
                        

题目请实现一个函数用来匹配包括'.'和'*'的正则表达式。
模式中的字符'.'表示任意一个字符，而'*'表示它前面的字符可以出现任意次（含0次）。
在本题中，匹配是指字符串的所有字符匹配整个模式。
例如，字符串"aaa"与模式"a.a"和"ab*...
                    
                </div>

                <div class="home-article-meta-info-container">
    <div class="home-article-meta-info">
        <span><i class="fas fa-history"></i>&nbsp;<span class="home-article-date" data-date="Thu Aug 18 2022 02:31:39 GMT+0800">2022-08-18</span></span>
        
            <span class="home-article-category"><i class="fas fa-folder"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/categories/Acwing/">Acwing</a>&nbsp;
                        </li>
                    
                    
                </ul>
            </span>
        
        
            <span class="home-article-tag">
                <i class="fas fa-tags"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/tags/%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%92/">动态规划</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E8%AE%B0%E5%BF%86%E5%8C%96%E6%90%9C%E7%B4%A2/">记忆化搜索</a>&nbsp;
                        </li>
                    
                </ul>
            </span>
        
    </div>

    <a href="/2022/08/18/AcWing%2030.%20%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E5%8C%B9%E9%85%8D/">阅读全文&nbsp;<i class="fas fa-angle-right"></i></a>
</div>

            </li>
        
            <li class="home-article-item">

                

                <h3 class="home-article-title">
                    <a href="/2022/08/18/AcWing%2018.%20%E9%87%8D%E5%BB%BA%E4%BA%8C%E5%8F%89%E6%A0%91/">
                        AcWing 18. 重建二叉树
                    </a>
                </h3>

                <div class="home-article-content markdown-body">
                    
                        

题目输入一棵二叉树前序遍历和中序遍历的结果，请重建该二叉树。
注意:

二叉树中每个节点的值都互不相同；
输入的前序遍历和中序遍历一定合法；

数据范围树中节点数量范围 。
样例给定：
前序遍历是：[3, 9, 20, 15, 7]
中序遍历是：...
                    
                </div>

                <div class="home-article-meta-info-container">
    <div class="home-article-meta-info">
        <span><i class="fas fa-history"></i>&nbsp;<span class="home-article-date" data-date="Thu Aug 18 2022 02:31:38 GMT+0800">2022-08-18</span></span>
        
            <span class="home-article-category"><i class="fas fa-folder"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/categories/Acwing/">Acwing</a>&nbsp;
                        </li>
                    
                    
                </ul>
            </span>
        
        
            <span class="home-article-tag">
                <i class="fas fa-tags"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/tags/%E6%A0%91%E7%9A%84%E9%81%8D%E5%8E%86/">树的遍历</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E9%80%92%E5%BD%92/">递归</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E5%93%88%E5%B8%8C%E8%A1%A8/">哈希表</a>&nbsp;
                        </li>
                    
                </ul>
            </span>
        
    </div>

    <a href="/2022/08/18/AcWing%2018.%20%E9%87%8D%E5%BB%BA%E4%BA%8C%E5%8F%89%E6%A0%91/">阅读全文&nbsp;<i class="fas fa-angle-right"></i></a>
</div>

            </li>
        
            <li class="home-article-item">

                

                <h3 class="home-article-title">
                    <a href="/2022/08/18/AcWing%2019.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E4%B8%8B%E4%B8%80%E4%B8%AA%E8%8A%82%E7%82%B9/">
                        AcWing 19. 二叉树的下一个节点
                    </a>
                </h3>

                <div class="home-article-content markdown-body">
                    
                        

题目给定一棵二叉树的其中一个节点，请找出中序遍历序列的下一个节点。
注意：

如果给定的节点是中序遍历序列的最后一个，则返回空节点;
二叉树一定不为空，且给定的节点一定不是空节点；

数据范围树中节点数量 。
样例假定二叉树是：[2, 1, 3,...
                    
                </div>

                <div class="home-article-meta-info-container">
    <div class="home-article-meta-info">
        <span><i class="fas fa-history"></i>&nbsp;<span class="home-article-date" data-date="Thu Aug 18 2022 02:31:37 GMT+0800">2022-08-18</span></span>
        
            <span class="home-article-category"><i class="fas fa-folder"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/categories/Acwing/">Acwing</a>&nbsp;
                        </li>
                    
                    
                </ul>
            </span>
        
        
            <span class="home-article-tag">
                <i class="fas fa-tags"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/tags/%E4%BA%8C%E5%8F%89%E6%A0%91/">二叉树</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E6%89%BE%E5%90%8E%E7%BB%A7/">找后继</a>&nbsp;
                        </li>
                    
                </ul>
            </span>
        
    </div>

    <a href="/2022/08/18/AcWing%2019.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E4%B8%8B%E4%B8%80%E4%B8%AA%E8%8A%82%E7%82%B9/">阅读全文&nbsp;<i class="fas fa-angle-right"></i></a>
</div>

            </li>
        
            <li class="home-article-item">

                

                <h3 class="home-article-title">
                    <a href="/2022/08/18/AcWing%201536.%20%E5%9D%87%E5%88%86%E7%BA%B8%E7%89%8C/">
                        AcWing 1536. 均分纸牌
                    </a>
                </h3>

                <div class="home-article-content markdown-body">
                    
                        

题目有堆纸牌，编号分别为 。
每堆上有若干张，但纸牌总数必为  的倍数。
可以在任一堆上取若干张纸牌，然后移动。
移牌规则为：在编号为  的堆上取的纸牌，只能移到编号为  的堆上；在编号为  的堆上取的纸牌，只能移到编号为  的堆上；其他堆上取的...
                    
                </div>

                <div class="home-article-meta-info-container">
    <div class="home-article-meta-info">
        <span><i class="fas fa-history"></i>&nbsp;<span class="home-article-date" data-date="Thu Aug 18 2022 02:31:36 GMT+0800">2022-08-18</span></span>
        
            <span class="home-article-category"><i class="fas fa-folder"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/categories/Acwing/">Acwing</a>&nbsp;
                        </li>
                    
                    
                </ul>
            </span>
        
        
            <span class="home-article-tag">
                <i class="fas fa-tags"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/tags/%E8%B4%AA%E5%BF%83/">贪心</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E9%80%92%E6%8E%A8/">递推</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E9%80%92%E5%BD%92/">递归</a>&nbsp;
                        </li>
                    
                </ul>
            </span>
        
    </div>

    <a href="/2022/08/18/AcWing%201536.%20%E5%9D%87%E5%88%86%E7%BA%B8%E7%89%8C/">阅读全文&nbsp;<i class="fas fa-angle-right"></i></a>
</div>

            </li>
        
            <li class="home-article-item">

                

                <h3 class="home-article-title">
                    <a href="/2022/08/18/AcWing%20104.%20%E8%B4%A7%E4%BB%93%E9%80%89%E5%9D%80/">
                        AcWing 104. 货仓选址
                    </a>
                </h3>

                <div class="home-article-content markdown-body">
                    
                        

题目在一条数轴上有  家商店，它们的坐标分别为 。
现在需要在数轴上建立一家货仓，每天清晨，从货仓到每家商店都要运送一车商品。
为了提高效率，求把货仓建在何处，可以使得货仓到每家商店的距离之和最小。
输入格式第一行输入整数 。
第二行  个整数 ...
                    
                </div>

                <div class="home-article-meta-info-container">
    <div class="home-article-meta-info">
        <span><i class="fas fa-history"></i>&nbsp;<span class="home-article-date" data-date="Thu Aug 18 2022 02:31:36 GMT+0800">2022-08-18</span></span>
        
            <span class="home-article-category"><i class="fas fa-folder"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/categories/Acwing/">Acwing</a>&nbsp;
                        </li>
                    
                    
                </ul>
            </span>
        
        
            <span class="home-article-tag">
                <i class="fas fa-tags"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/tags/%E8%B4%AA%E5%BF%83/">贪心</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E6%8E%92%E5%BA%8F/">排序</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E5%BF%AB%E9%80%9F%E9%80%89%E6%8B%A9%E7%AE%97%E6%B3%95/">快速选择算法</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E7%BB%9D%E5%AF%B9%E5%80%BC%E4%B8%8D%E7%AD%89%E5%BC%8F/">绝对值不等式</a>&nbsp;
                        </li>
                    
                </ul>
            </span>
        
    </div>

    <a href="/2022/08/18/AcWing%20104.%20%E8%B4%A7%E4%BB%93%E9%80%89%E5%9D%80/">阅读全文&nbsp;<i class="fas fa-angle-right"></i></a>
</div>

            </li>
        
            <li class="home-article-item">

                

                <h3 class="home-article-title">
                    <a href="/2022/08/18/AcWing%20122.%20%E7%B3%96%E6%9E%9C%E4%BC%A0%E9%80%92/">
                        AcWing 122. 糖果传递
                    </a>
                </h3>

                <div class="home-article-content markdown-body">
                    
                        

题目有  个小朋友坐成一圈，每人有  个糖果。
每人只能给左右两人传递糖果。
每人每次传递一个糖果代价为 。
求使所有人获得均等糖果的最小代价。
输入格式第一行输入一个正整数 ，表示小朋友的个数。
接下来  行，每行一个整数 ，表示第  个小朋友...
                    
                </div>

                <div class="home-article-meta-info-container">
    <div class="home-article-meta-info">
        <span><i class="fas fa-history"></i>&nbsp;<span class="home-article-date" data-date="Thu Aug 18 2022 02:31:35 GMT+0800">2022-08-18</span></span>
        
            <span class="home-article-category"><i class="fas fa-folder"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/categories/Acwing/">Acwing</a>&nbsp;
                        </li>
                    
                    
                </ul>
            </span>
        
        
            <span class="home-article-tag">
                <i class="fas fa-tags"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/tags/%E8%B4%AA%E5%BF%83/">贪心</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E6%8E%92%E5%BA%8F/">排序</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E4%B8%AD%E4%BD%8D%E6%95%B0/">中位数</a>&nbsp;
                        </li>
                    
                        <li>
                            | 
                            <a href="/tags/%E6%8E%A8%E5%85%AC%E5%BC%8F/">推公式</a>&nbsp;
                        </li>
                    
                </ul>
            </span>
        
    </div>

    <a href="/2022/08/18/AcWing%20122.%20%E7%B3%96%E6%9E%9C%E4%BC%A0%E9%80%92/">阅读全文&nbsp;<i class="fas fa-angle-right"></i></a>
</div>

            </li>
        
            <li class="home-article-item">

                

                <h3 class="home-article-title">
                    <a href="/2022/08/18/AcWing%20106.%20%E5%8A%A8%E6%80%81%E4%B8%AD%E4%BD%8D%E6%95%B0/">
                        AcWing 106. 动态中位数
                    </a>
                </h3>

                <div class="home-article-content markdown-body">
                    
                        

题目依次读入一个整数序列，每当已经读入的整数个数为奇数时，输出已读入的整数构成的序列的中位数。
输入格式第一行输入一个整数 ，代表后面数据集的个数，接下来若干行输入各个数据集。
每个数据集的第一行首先输入一个代表数据集的编号的整数。
然后输入一个...
                    
                </div>

                <div class="home-article-meta-info-container">
    <div class="home-article-meta-info">
        <span><i class="fas fa-history"></i>&nbsp;<span class="home-article-date" data-date="Thu Aug 18 2022 02:31:34 GMT+0800">2022-08-18</span></span>
        
            <span class="home-article-category"><i class="fas fa-folder"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/categories/Acwing/">Acwing</a>&nbsp;
                        </li>
                    
                    
                </ul>
            </span>
        
        
            <span class="home-article-tag">
                <i class="fas fa-tags"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/tags/%E5%A0%86/">堆</a>&nbsp;
                        </li>
                    
                </ul>
            </span>
        
    </div>

    <a href="/2022/08/18/AcWing%20106.%20%E5%8A%A8%E6%80%81%E4%B8%AD%E4%BD%8D%E6%95%B0/">阅读全文&nbsp;<i class="fas fa-angle-right"></i></a>
</div>

            </li>
        
            <li class="home-article-item">

                

                <h3 class="home-article-title">
                    <a href="/2022/08/18/AcWing%2033.%20%E9%93%BE%E8%A1%A8%E4%B8%AD%E5%80%92%E6%95%B0%E7%AC%ACk%E4%B8%AA%E8%8A%82%E7%82%B9/">
                        AcWing 33. 链表中倒数第k个节点
                    </a>
                </h3>

                <div class="home-article-content markdown-body">
                    
                        

题目输入一个链表，输出该链表中倒数第  个结点。
注意：

k &gt;= 1;
如果  大于链表长度，则返回 NULL;

数据范围链表长度 。
样例输入：链表：1-&gt;2-&gt;3-&gt;4-&gt;5 ，k=2

输出：4

题解快...
                    
                </div>

                <div class="home-article-meta-info-container">
    <div class="home-article-meta-info">
        <span><i class="fas fa-history"></i>&nbsp;<span class="home-article-date" data-date="Thu Aug 18 2022 02:31:33 GMT+0800">2022-08-18</span></span>
        
            <span class="home-article-category"><i class="fas fa-folder"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/categories/Acwing/">Acwing</a>&nbsp;
                        </li>
                    
                    
                </ul>
            </span>
        
        
            <span class="home-article-tag">
                <i class="fas fa-tags"></i>&nbsp;
                <ul>
                    
                        <li>
                            
                            <a href="/tags/%E9%93%BE%E8%A1%A8/">链表</a>&nbsp;
                        </li>
                    
                </ul>
            </span>
        
    </div>

    <a href="/2022/08/18/AcWing%2033.%20%E9%93%BE%E8%A1%A8%E4%B8%AD%E5%80%92%E6%95%B0%E7%AC%ACk%E4%B8%AA%E8%8A%82%E7%82%B9/">阅读全文&nbsp;<i class="fas fa-angle-right"></i></a>
</div>

            </li>
        
    </ul>

    <div class="home-paginator">
        <div class="paginator">
    
        <a class="prev btn"
           href="/page/3/"
        >上一页</a>
    

    
        <a class="next btn"
           href="/page/5/"
        >下一页</a>
    
</div>

    </div>
</div>


                
            </div>

        </div>

        <div class="page-main-content-bottom">
            <footer class="footer">
    <div class="info-container">
        <div class="copyright-info info-item">
            &copy;
            
              <span>2020</span>
              -
            
            2023&nbsp;<i class="fas fa-heart icon-animate"></i>&nbsp;<a href="/">宋标</a>
        </div>
        
        <div class="theme-info info-item">
            由 <a target="_blank" href="https://hexo.io">Hexo</a> 驱动&nbsp;|&nbsp;主题&nbsp;<a class="theme-version" target="_blank" href="https://github.com/XPoet/hexo-theme-keep">Keep v3.4.5</a>
        </div>
        
        
    </div>
</footer>

        </div>
    </div>

    

    <div class="right-bottom-side-tools">
        <div class="side-tools-container">
    <ul class="side-tools-list">
        <li class="tools-item tool-font-adjust-plus flex-center">
            <i class="fas fa-search-plus"></i>
        </li>

        <li class="tools-item tool-font-adjust-minus flex-center">
            <i class="fas fa-search-minus"></i>
        </li>

        <li class="tools-item tool-expand-width flex-center">
            <i class="fas fa-arrows-alt-h"></i>
        </li>

        <li class="tools-item tool-dark-light-toggle flex-center">
            <i class="fas fa-moon"></i>
        </li>

        <!-- rss -->
        

        
            <li class="tools-item tool-scroll-to-top flex-center">
                <i class="fas fa-arrow-up"></i>
            </li>
        

        <li class="tools-item tool-scroll-to-bottom flex-center">
            <i class="fas fa-arrow-down"></i>
        </li>
    </ul>

    <ul class="exposed-tools-list">
        <li class="tools-item tool-toggle-show flex-center">
            <i class="fas fa-cog fa-spin"></i>
        </li>
        
    </ul>
</div>

    </div>

    

    <div class="image-viewer-container">
    <img src="">
</div>


    
        <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
          <span class="search-input-field-pre">
            <i class="fas fa-keyboard"></i>
          </span>
            <div class="search-input-container">
                <input autocomplete="off"
                       autocorrect="off"
                       autocapitalize="off"
                       placeholder="搜索..."
                       spellcheck="false"
                       type="search"
                       class="search-input"
                >
            </div>
            <span class="popup-btn-close">
                <i class="fas fa-times"></i>
            </span>
        </div>
        <div id="search-result">
            <div id="no-result">
                <i class="fas fa-spinner fa-pulse fa-5x fa-fw"></i>
            </div>
        </div>
    </div>
</div>

    

</main>





<script src="/js/utils.js"></script>

<script src="/js/main.js"></script>

<script src="/js/header-shrink.js"></script>

<script src="/js/back2top.js"></script>

<script src="/js/dark-light-toggle.js"></script>



    
<script src="/js/local-search.js"></script>







<div class="post-scripts">
    
</div>



</body>
</html>
